#include <iostream>
#include <cstring>
#include <algorithm>

using namespace std;

const int N = 110, M = 25010;

int n;
int a[N];
int dp[M];
// dp[j]表示 金额为j用a[]表示出来的方案数

int main()
{
    int T;
    cin >> T;
    
    while (T -- )
    {
        cin >> n;
        // 面值的最大值
        int maxv = 0;
        for (int i = 1; i <= n; i ++ ) {
            cin >> a[i];
            maxv = max(maxv, a[i]);
        }
        
        memset(dp, 0, sizeof dp);
        dp[0] = 1;
        
        
        int res = 0;
        // 完全背包问题
        for (int i = 1; i <= n; i ++ )
            for (int j = a[i]; j <= maxv; j ++ )
                dp[j] += dp[j - a[i]];
        
        for (int i = 1; i <= n; i ++ )
            if (dp[a[i]] == 1) res ++ ;
        cout << res << endl;
    }
    
    return 0;
}
